package com.maidou.qiantai.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.maidou.qiantai.mapper.OsOrderReturnReasonMapper;
import com.maidou.qiantai.domain.OsOrderReturnReason;
import com.maidou.qiantai.service.IOsOrderReturnReasonService;

/**
 * 退货原因Service业务层处理
 * 
 * @author maidou
 * @date 2024-03-15
 */
@Service
public class OsOrderReturnReasonServiceImpl implements IOsOrderReturnReasonService 
{
    @Autowired
    private OsOrderReturnReasonMapper osOrderReturnReasonMapper;

    /**
     * 查询退货原因
     * 
     * @param id 退货原因主键
     * @return 退货原因
     */
    @Override
    public OsOrderReturnReason selectOsOrderReturnReasonById(Long id)
    {
        return osOrderReturnReasonMapper.selectOsOrderReturnReasonById(id);
    }

    /**
     * 查询退货原因列表
     * 
     * @param osOrderReturnReason 退货原因
     * @return 退货原因
     */
    @Override
    public List<OsOrderReturnReason> selectOsOrderReturnReasonList(OsOrderReturnReason osOrderReturnReason)
    {
        return osOrderReturnReasonMapper.selectOsOrderReturnReasonList(osOrderReturnReason);
    }

    /**
     * 新增退货原因
     * 
     * @param osOrderReturnReason 退货原因
     * @return 结果
     */
    @Override
    public int insertOsOrderReturnReason(OsOrderReturnReason osOrderReturnReason)
    {
        osOrderReturnReason.setCreateTime(DateUtils.getNowDate());
        return osOrderReturnReasonMapper.insertOsOrderReturnReason(osOrderReturnReason);
    }

    /**
     * 修改退货原因
     * 
     * @param osOrderReturnReason 退货原因
     * @return 结果
     */
    @Override
    public int updateOsOrderReturnReason(OsOrderReturnReason osOrderReturnReason)
    {
        return osOrderReturnReasonMapper.updateOsOrderReturnReason(osOrderReturnReason);
    }

    /**
     * 批量删除退货原因
     * 
     * @param ids 需要删除的退货原因主键
     * @return 结果
     */
    @Override
    public int deleteOsOrderReturnReasonByIds(Long[] ids)
    {
        return osOrderReturnReasonMapper.deleteOsOrderReturnReasonByIds(ids);
    }

    /**
     * 删除退货原因信息
     * 
     * @param id 退货原因主键
     * @return 结果
     */
    @Override
    public int deleteOsOrderReturnReasonById(Long id)
    {
        return osOrderReturnReasonMapper.deleteOsOrderReturnReasonById(id);
    }
}
